package com.m7788.util;
import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;

import com.m7788.screen.R;
import com.tool.utils.LogoutUtil;
public class DialogChooseMenu  extends Dialog implements OnClickListener{
	
		OnChoosePhotoListener onChoosePhotoListener;
		@Override
		public void cancel() {
			super.cancel();
		}

		public DialogChooseMenu(Context context,OnChoosePhotoListener opl) {
			super(context,R.style.dialog);
			this.onChoosePhotoListener = opl;
			
			this.setContentView(R.layout.dialog_choose_menu);
			LinearLayout camera = (LinearLayout) findViewById(R.id.dcm_ll_camera);
			camera.setOnClickListener(this);
			
			LinearLayout cancel = (LinearLayout) findViewById(R.id.dcm_ll_cancel);
			cancel.setOnClickListener(this);
			
			LinearLayout cameraAuto = (LinearLayout) findViewById(R.id.dcm_ll_file);
			cameraAuto.setOnClickListener(this);
		}

		@Override
		public void onClick(View v) {
			this.dismiss();
			switch(v.getId()){
			case R.id.dcm_ll_camera:
				onChoosePhotoListener.refreshImage(10);
				
				break;
			case R.id.dcm_ll_file:
				onChoosePhotoListener.refreshImage(20);
				//IndexScreen.mWebView.loadUrl(url,parmasMap);
				//DataUtil.showShortToast(DialogChooseMenu.this, "访问首页");
				break;
			case R.id.dcm_ll_cancel:
				LogoutUtil.getInstance().exit();
				break;
			
			}
			
		}
		public interface OnChoosePhotoListener{
			public void refreshImage(int flag);
			}
}
